package com.sunflower.bath.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.sunflower.framework.utils.JsonResult;

import com.sunflower.bath.model.JobServerDb;
import com.sunflower.bath.service.IJobServerDbService;
@Controller
@RequestMapping(value = "jobserverdb")
public class JobServerDbController {
	private final Logger logger = LoggerFactory.getLogger(getClass());
	@Autowired
	private IJobServerDbService jobServerDbService;
	/**
	 * 新增数据库
	 * @param map
	 * @param JobServerDb
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/add", method = { RequestMethod.GET })
	public JsonResult addJobServerDb(ModelMap map, JobServerDb model){
		
		JsonResult jr = JsonResult.newInstance();
		String reslut = jobServerDbService.insert(model);
		return reslut==null?jr.declareSuccess():jr.declareFailure(reslut);
	}
}
